#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>

using std::vector;
using std::cin;
using std::cout;

template <typename iter>
iter add_partition(iter begin, iter end, iter part, int x) {
    iter flag = part;
    while (begin != flag) {
        if (*begin == x) {
            std::swap(*begin, *flag);
            --flag;
            continue;
        }
        ++begin;
    }
    while (end != part) {
        if (*end == x) {
            std::swap(*end, *part);
            ++part;
            continue;
        }
        --end;
    }
    flag++;
    return flag;
}
template <typename iter>
iter partition(iter begin, iter end, int x, int &cnt) {
    if(end == begin)
        return begin;
    --end;
    cnt = 0;
    iter begin0 = begin, end0 = end;
    while (begin != end) {
        if (*begin < x) {
            ++begin;
            continue;
        }
        if (*end >= x) {
            if (*end == x) {
                ++cnt;
            }
            --end;
            continue;
        }
        std::swap(*begin, *end);
    }
    if (*end == x) {
        ++cnt;
    }
    while (*begin < x)
        ++begin;

    return add_partition(begin0, end0, begin, x);
}

template <typename iter>
void qsort (iter begin, iter end) {
    if (end - begin <= 1)
        return;
    iter mid = begin + std::rand() % (end - begin);
    int cnt;
    iter part = partition(begin, end, *mid, cnt);
    qsort(begin, part);
    qsort(part + cnt - 1, end);
}

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    qsort(a.begin(), a.end());
    copy(a.begin(), a.end(), std::ostream_iterator<int>(cout, " "));
    return 0;
}